package com.zoffy.ybuhelper.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import com.zoffy.ybuhelper.pojo.entity.Category;
import com.zoffy.ybuhelper.pojo.entity.Origin;

import java.util.List;

@Dao
public interface OriginDao {
    @Insert
    void insert(Origin... origin);
    @Query("SELECT id,name,deleted FROM origin;")
    List<Origin> getAll();
    @Query("DELETE FROM origin WHERE id=:id;")
    void deleteById(Integer id);

    @Query("UPDATE origin SET name=:name WHERE id=:id")
    void updateName(Integer id,String name);
    @Query("SELECT id,name,deleted FROM origin WHERE id=:id")
    Origin get(Integer id);
    @Query("UPDATE origin SET deleted=:deleted WHERE id=:id")
    void updateDeleted(Integer id,Integer deleted);
}
